package com.qst.dms.entity;

import java.text.SimpleDateFormat;
import java.util.Date;

//货运物流信息
public class Transport extends DataBase{
    //经手人
    private String handler;
    //收货人
    private String receiver;
    //物流状态
    private int transportType;
    //物流状态常量：发货中，送货中，已签收
    public static final int SENDDING=1;
    public static final int TRANSPORTING=1;
    public static final int RECEIVEED=1;

    public String getHandler() {
        return handler;
    }

    public void setHandler(String handler) {
        this.handler = handler;
    }

    public String getReceiver() {
        return receiver;
    }

    public void setReceiver(String receiver) {
        this.receiver = receiver;
    }

    public int getTransportType() {
        return transportType;
    }

    public void setTransportType(int transportType) {
        this.transportType = transportType;
    }
    public Transport(){

    }
    public Transport(int id,Date time,String address,int type,String handler,String receiver,int transportType){
       super(id,time,address,type);
        this.handler=handler;
        this.receiver=receiver;
        this.transportType=transportType;
    }
    public String toString(){
       Date d=getTime();

        SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");

        String time=df.format(d);
        return this.getId()+","+this.getTime()+","+this.getAddress()+","+this.getType()+","+ handler+','+ receiver+','+ transportType;
    }
}
/* Date转String

Date d=new Date();

SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");

String ds=df.format(d);



2 String转Date

String ds=new String("2017-06-09 10:22:22");

Date sd=df.parse(ds);
*/